<template>
  <div>
    <van-swipe class="my-swipe" :autoplay="1000" indicator-color="#333">
      <van-swipe-item v-for="(image, index) in images" :key="index">
        <img v-lazy="image" />
      </van-swipe-item>
    </van-swipe>
    <div class="scan">
      <i class="iconfont icon-scan icon-size"></i>
    </div>
  </div>
</template>

<script>
import Vue from "vue";
import { Swipe, SwipeItem, Lazyload } from "vant";

Vue.use(Swipe)
  .use(SwipeItem)
  .use(Lazyload);
export default {
  name: "carousel",
  props: {
    images: Array
  }
};
</script>

<style scoped>
.my-swipe {
  width: 100%;
  height: 38vh;
}
.my-swipe img {
  width: 100%;
  height: 100%;
}
::v-deep .van-swipe__indicators {
  bottom: 4.5vh;
}
::v-deep .van-swipe__indicator {
  background-color: gray;
  width: 0.2rem;
  height: 0.2rem;
}
.scan {
  position: absolute;
  top: 1rem;
  right: 0.5rem;
  height: 1rem;
  width: 1rem;
  border-radius: 20px;
  background-color: #000;
  opacity: 0.4;
  color: #fff;
  text-align: center;
}
.icon-size {
  font-size: 24px;
  line-height: 1rem;
}
</style>